SimplePlatformerController = function(gameObject, runSpeed) {
    Controller.call(this, gameObject);
    this.runSpeed = runSpeed;
};

SimplePlatformerController.prototype = Object.create(Controller.prototype);

SimplePlatformerController.prototype.run = function() {
    if (this.onDebug) {
        this.onDebug();
    }

    var runSpeed = this.runSpeed || this.gameObject.speedX;

    if (input.left) {
        this.gameObject.vx = -runSpeed;
        if (this.gameObject.currAnimationName != "walk_l") {
            this.gameObject.animation.gotoAndPlay("walk_l");
            this.gameObject.currAnimationName = "walk_l";
        }
        this.gameObject.facingRight = false;
    } else if (input.right) {
        this.gameObject.vx = runSpeed;
        if (this.gameObject.currAnimationName != "walk_r") {
            this.gameObject.animation.gotoAndPlay("walk_r");
            this.gameObject.currAnimationName = "walk_r";
        }
        this.gameObject.facingRight = true;
    } else {
        this.gameObject.vx = 0;
        if (this.gameObject.facingRight) {
            if (this.gameObject.currAnimationName != "idle_r") {
                this.gameObject.animation.gotoAndPlay("idle_r");
                this.gameObject.currAnimationName = "idle_r";
            }
        } else {
            if (this.gameObject.currAnimationName != "idle_l") {
                this.gameObject.animation.gotoAndPlay("idle_l");
                this.gameObject.currAnimationName = "idle_l";
            }
        }
    }




}; //run
